WeldEjbInjectionServices{
  if (serviceRegistry == null) {
  this.serviceRegistry=serviceRegistry;
  this.moduleDescription=moduleDescription;
  this.applicationDescription=applicationDescription;
}
resolveEjb{
  EJB ejb=injectionPoint.getAnnotated().getAnnotation(EJB.class);
    throw WeldMessages.MESSAGES.annotationNotFound(EJB.class,injectionPoint.getMember());
  if (injectionPoint.getMember() instanceof Method && ((Method)injectionPoint.getMember()).getParameterTypes().length != 1) {
    throw WeldMessages.MESSAGES.injectionPointNotAJavabean((Method)injectionPoint.getMember());
  if (!ejb.lookup().equals("")) {
    final ContextNames.BindInfo ejbBindInfo=ContextNames.bindInfoFor(moduleDescription.getApplicationName(),moduleDescription.getModuleName(),moduleDescription.getModuleName(),ejb.lookup());
    ServiceController<?> controller=serviceRegistry.getRequiredService(ejbBindInfo.getBinderServiceName());
    ManagedReferenceFactory factory=(ManagedReferenceFactory)controller.getValue();
    return factory.getReference().getInstance();
    final Set<ViewDescription> viewService;
    if (ejb.beanName().isEmpty()) {
      if (ejb.beanInterface() != Object.class) {
        viewService=applicationDescription.getComponentsForViewName(ejb.beanInterface().getName(),deploymentRoot);
        viewService=applicationDescription.getComponentsForViewName(getType(injectionPoint.getType()).getName(),deploymentRoot);
      if (ejb.beanInterface() != Object.class) {
        viewService=applicationDescription.getComponents(ejb.beanName(),ejb.beanInterface().getName(),deploymentRoot);
        viewService=applicationDescription.getComponents(ejb.beanName(),getType(injectionPoint.getType()).getName(),deploymentRoot);
    if (viewService.isEmpty()) {
      throw WeldMessages.MESSAGES.ejbNotResolved(ejb,injectionPoint.getMember());
 else     if (viewService.size() > 1) {
      throw WeldMessages.MESSAGES.moreThanOneEjbResolved(ejb,injectionPoint.getMember(),viewService);
    final ViewDescription viewDescription=viewService.iterator().next();
    final ServiceController<?> controller=serviceRegistry.getRequiredService(viewDescription.getServiceName());
    final ComponentView view=(ComponentView)controller.getValue();
      return view.createInstance().getInstance();
}
cleanup{ }
getType{
    return getType(((ParameterizedType)type).getRawType());
    throw WeldMessages.MESSAGES.couldNotDetermineUnderlyingType(type);
}
